-
Notifications
You must be signed in to change notification settings - Fork 52
Add FFT extension to the spec #189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @steff456, this looks good overall, just some small comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work @steff456! Thanks for putting these together. Based on the recent discussion summarized in #159 (comment), could you remove all *fft2
APIs? Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for my late response @steff456...I just reviewed {i}fft
and {i}fftn
and left some comments. We should reorder the list so that each pair of transforms appears together (see my comment below). I'll try to resume tomorrow...😅
@leofang I already made the changes, please let me know if there's something else we can improve here :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @steff456! I have reviewed fft
/ifft
/fftn
/ifftn
/rfft
/irfft
/rfftn
/irfftn
. I think C2C transforms (fft
/ifft
/fftn
/ifftn
) are in good shape now, but more work is needed for R2C/C2R transforms as the behavior is a bit messy and confusing. I hope we could find another pair of eyes to go over these.
I will try to finish the rest of reviews (hfft, fftfreq, etc) asap...
@steff456 The table looks correct. Thanks for putting that together. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for delay. I reviewed all functions but rfftn
and irfftn
, as there are still errors to be ironed out in the R2C/C2R(-like) transforms. I also have a few proposals to simplify the standard, see my comments below.
Note that the input/output data types should be taken care, as noted in previous rounds of review, including:
- input data type promotion when applicable (pending Complex type promotion rules are unclear #478)
- reject inconsistent input data types in R2C/C2R transforms
spec/API_specification/array_api/fourier_transform_functions.py
Outdated
Show resolved
Hide resolved
spec/API_specification/array_api/fourier_transform_functions.py
Outdated
Show resolved
Hide resolved
spec/API_specification/array_api/fourier_transform_functions.py
Outdated
Show resolved
Hide resolved
spec/API_specification/array_api/fourier_transform_functions.py
Outdated
Show resolved
Hide resolved
spec/API_specification/array_api/fourier_transform_functions.py
Outdated
Show resolved
Hide resolved
spec/API_specification/array_api/fourier_transform_functions.py
Outdated
Show resolved
Hide resolved
spec/API_specification/array_api/fourier_transform_functions.py
Outdated
Show resolved
Hide resolved
spec/API_specification/array_api/fourier_transform_functions.py
Outdated
Show resolved
Hide resolved
spec/API_specification/array_api/fourier_transform_functions.py
Outdated
Show resolved
Hide resolved
spec/API_specification/array_api/fourier_transform_functions.py
Outdated
Show resolved
Hide resolved
Another note: As discussed in a prior meeting it is preferable to add a note that the output dtype will be consistent with the input dtype (ex: we don't always promote to complex128 as NumPy currently does even if the input is in single precision), but I think if we word it correctly when addressing #478 this need should be automatically resolved. |
Hi @steff456 Do you have local changes that you have not pushed? If not, may I edit in your branch directly? |
Hi @leofang, go ahead and make changes! Thanks a lot 😬 |
@kgryte @rgommers @peterbell10 @toslunar @steff456 @oleksandr-pavlyk This should be ready now. Any chance any of you can take a look? Otherwise, I'll self-merge before the next Array API meeting (Oct 20). |
spec/API_specification/array_api/fourier_transform_functions.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Announced in the meeting, let's merge. We can follow up with additional PRs if needed. |
PR-URL: #720 Closes: #717 Closes: #718 Ref: #189 Co-authored-by: Leo Fang <[email protected]> Co-authored-by: Athan Reines <[email protected]> Reviewed-by: Leo Fang <[email protected]> Reviewed-by: Athan Reines <[email protected]> Reviewed-by: Ralf Gommers <[email protected]>
This PR focuses on adding the FFT as an extension to the array spec.
The current APIs added in this PR are:
They follow the summary available at #159. Close #476.